using Model;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dao
{
    public  class Permit_UserDM
    {
        public Permit_User Get_UserBM(string UserCode, string pow)
        {
            if (string.IsNullOrEmpty(UserCode) || string.IsNullOrEmpty(pow))
            {
                return null;
            }
            return DB.MySqlDbSqlSugar.Queryable<Permit_User>().Where(p=>p.UserCode == UserCode && p.pow == pow && p.status ==0).First();
        }

        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="page">页</param>
        /// <param name="limit">条数</param>
        /// <param name="count">总数</param>
        /// <returns></returns>
        public List<UserList> GetListUser(int page, int limit, ref int count)
        {
            return DB.MySqlDbSqlSugar.Queryable<UserList>().OrderBy(it => it.id).ToPageList(page, limit, ref count);
        }

    }
}
